home *** CD-ROM | disk | FTP | other *** search
- Path: news.win.tue.nl!not-for-mail
- From: dedos8@wsintt09.win.tue.nl (Arnaud Gouder de Beauregard)
- Newsgroups: comp.lang.c++
- Subject: Templates problem: I don't get this :(
- Date: 1 Mar 1996 14:40:11 +0100
- Organization: Eindhoven University of Technology, The Netherlands
- Message-ID: <4h6unr$3hu@wsintt09.win.tue.nl>
- NNTP-Posting-Host: wsintt09.win.tue.nl
- X-Newsreader: TIN [version 1.2 PL2]
-
- I tried to make a Binary Tree with templates, but the following won't
- compile: What am I doing wrong ?
-
-
-
- template <class T>
- class Tree
- {
- TreeNode<T> *root;
- };
-
- template <class T>
- class TreeNode
- {
- T value;
- Tree<T> left; // Here is ther problem. A pointer IS allowed, but I
- // don't want that.
- };
-
- int main()
- {
- Tree<int> t;
- return 0;
- }
-
- Greets,
-
- Arnaud
- --
- Arnaud Gouder - dedos8@win.tue.nl - chiller@hvision.nl
-
-